<?php

class Controller_Index extends Controller_Website
{

    public function before() {
        parent::before();
        $this->section = 'index';

        //testimonials slider old
//        $this->addScript('/scripts/jcarousel/jquery-1.4.2.min.js');
//        $this->addScript('/scripts/jcarousel/jquery.jcarousel.js');
//        $this->addScript('/scripts/jcarousel/jquery.jcarousel.min.js');
//        $this->addScript('/scripts/jcarousel/settings.js');
//        $this->addStyle('/styles/jcarousel/skin.css');

        //new jcarousel lite
        $this->addScript('/scripts/jcarousel_lite/jcarousellite_1.0.1c4.js');
        $this->addScript('/scripts/jcarousel_lite/jquery.easing.1.3.js');

        $this->addScript('/scripts/jquery.placeholder.min.js');

        //top slider
        $this->addScript('/scripts/slider/slides.min.jquery.js');
        $this->addScript('/scripts/slider/settings.js');

        //my slider
//        $this->addScript('/scripts/slider_john2.js');
//        $this->addStyle('/styles/slider_john.css');


        $this->mod = Model::factory('directory');
        $this->man = Model::factory('manager');
        $this->template->activeCat = 'index';
    }

	public function actionIndex()
	{
	$this->template->title = $this->settings['title'];
        $this->template->content = new View('index/index');
        $leftBlock=$this->mod->getItems('indextext');
        $this->template->content->leftBlock=array_shift($leftBlock);
        $this->template->content->centerImages=$this->mod->getImagesPosition('indeximages');
        $this->template->content->testimonials=$this->man->getTestimonialsIndex('indextestimonials','position');

        $this->template->content->giftcards = $this->direc->getItemImages(108, 'indexgifts', $order = 'id', $orderDir = 'ASC');

    }
}